import Vue from 'vue'
import Router from 'vue-router'
import store from '../vuex/store'
import config from './config'


Vue.use(Router)

// MainView
import MainView from '../views/MainView.vue'
import LoanInView from '../views/LoanInView.vue'
import LoanInIndexView from '../views/LoanInIndexView.vue'
import LoanIndexView from '../views/LoanIndexView.vue'
import LoanOutView from '../views/LoanOutView.vue'
import LoanOutIndexView from '../views/LoanOutIndexView.vue'
import UserView from '../views/UserView.vue'
import UserIndexView from '../views/UserIndexView.vue'
import ContactView from '../views/ContactView.vue'
import ContactIndexView from '../views/ContactIndexView.vue'


import ContactAddView from '../views/ContactAddView.vue'
import ContactDetailView from '../views/ContactDetailView.vue'


import LoanDetailView from '../views/LoanDetailView.vue'
import LoanInWantView from '../views/LoanInWantView.vue'
import LoanInWantIndexView from '../views/LoanInWantIndexView.vue'
import LoanInApplyView from '../views/LoanInApplyView.vue'
import LoanInWantUseView from '../views/LoanInWantUseView.vue'
import LoanInSuccessView from '../views/LoanInSuccessView.vue'
import LoanInDetailMeView from '../views/LoanInDetailMeView.vue'
import LoanInDetailOtherView from '../views/LoanInDetailOtherView.vue'


import LoanOutRecordView from '../views/LoanOutRecordView.vue'
import LoanOutWantView from '../views/LoanOutWantView.vue'
import LoanOutWantIndexView from '../views/LoanOutWantIndexView.vue'
import LoanOutSuccessView from '../views/LoanOutSuccessView.vue'
import LoanOutDetailMeView from '../views/LoanOutDetailMeView.vue'
import LoanOutDetailOtherView from '../views/LoanOutDetailOtherView.vue'
import LoanOutApplyView from '../views/LoanOutApplyView.vue'
import LoanIOUView from '../views/LoanIOUView.vue'
import LoanIOUAddView from '../views/LoanIOUAddView.vue'
import LoanIOUDetailView from '../views/LoanIOUDetailView.vue'
import LoanIOUListView from '../views/LoanIOUListView.vue'

import UserMoneyDetailView from '../views/UserMoneyDetailView.vue'
import UserNoRepaymentVIew from '../views/UserNoRepaymentVIew.vue'
import UserLoanInVIew from '../views/UserLoanInVIew.vue'
import UserLoanInDetailView from '../views/UserLoanInDetailView.vue'
import UserLoanOutVIew from '../views/UserLoanOutVIew.vue'
import UserLoanOutDetailView from '../views/UserLoanOutDetailView.vue'
import UserWithDrawView from '../views/UserWithDrawView.vue'
import UserRechargeView from '../views/UserRechargeView.vue'
import UserRechargeVoucherView from '../views/UserRechargeVoucherView.vue'
import UserMyVoucherView from '../views/UserMyVoucherView.vue'
import UserVoucherRecordView from '../views/UserVoucherRecordView.vue'
import UserMineView from '../views/UserMineView.vue'
import UserBindCardView from '../views/UserBindCardView.vue'
import UserBindCardVerifiedView from '../views/UserBindCardVerifiedView.vue'
import UserBindCardTransactionPasswordView from '../views/UserBindCardTransactionPasswordView.vue'
import UserBindCardSuccessView from '../views/UserBindCardSuccessView.vue'
import UserBindCardListView from '../views/UserBindCardListView.vue'
import UserAddCardView from '../views/UserAddCardView.vue'
import UserCreditReportView from '../views/UserCreditReportView.vue'
import UserCreditReportIndexView from '../views/UserCreditReportIndexView.vue'
import UserCreditReportUserInfoView from '../views/UserCreditReportUserInfoView.vue'
import UserCreditReportZmxyView from '../views/UserCreditReportZmxyView.vue'
import UserCreditReportOperatorsView from '../views/UserCreditReportOperatorsView.vue'
import UserCreditReportOperators360View from '../views/UserCreditReportOperators360View.vue'
import UserCreditReportJdView from '../views/UserCreditReportJdView.vue'
import UserCreditReportListView from '../views/UserCreditReportListView.vue'
import UserCreditReportDetailView from '../views/UserCreditReportDetailView.vue'
import UserPasswordManageView from '../views/UserPasswordManageView.vue'
import UserPasswordFindLoginView from '../views/UserPasswordFindLoginView.vue'
import UserPasswordFindTransactionView from '../views/UserPasswordFindTransactionView.vue'
import UserPasswordSetLoginView from '../views/UserPasswordSetLoginView.vue'
import UserPasswordSetTransactionView from '../views/UserPasswordSetTransactionView.vue'
import UserPasswordSetSuccessView from '../views/UserPasswordSetSuccessView.vue'


import RepaymentView from '../views/RepaymentView.vue'

import HelpView from '../views/HelpView.vue'

import BlackListView from '../views/BlackListView.vue'

import AboutView from '../views/AboutView.vue'

import AgreementView from '../views/AgreementView.vue'

import ShareLoanInView from '../views/ShareLoanInView.vue'
import ShareLoanOutView from '../views/ShareLoanOutView.vue'
import ShareCommonView from '../views/ShareCommonView.vue'


import MessageBoxView from '../views/MessageBoxView.vue'
import MessageBoxDetailView from '../views/MessageBoxDetailView.vue'

import ViewRecordView from '../views/ViewRecordView.vue'

import IdSelectView from '../views/IdSelectView.vue'





// BindView
import BindView from '../views/BindView.vue'
import BindPhoneView from '../views/BindPhoneView.vue'
// 邀请有奖
// InvitePrize
// import InvitePrizeView from '../views/InvitePrizeView.vue'

let router = new Router({
    routes: [{
        path: '/main',
        name: 'main',
        component: MainView,
        children: [{
            path: '/loan-in-index',
            name: 'loan-in-index',
            meta:{
                title:'首页'
            },
            component: LoanInIndexView,
        },{
            path: '/loan-out-index',
            name: 'loan-out-index',
            meta:{
                title:'首页'
            },
            component: LoanOutIndexView
        },{
            path: '/loan-index',
            name: 'loan-index',
            meta:{
                title:'首页'
            },
            component: LoanIndexView
        },{
            path: '/user-index',
            name: 'user-index',
            meta:{
                title:'账户'
            },
            component: UserIndexView
        },{
            path: '/contac-index',
            name: 'contac-index',
            meta:{
                title:'联系人'
            },
            component: ContactIndexView
        }]
    },{
        path: '/bind',
        name: 'bind',
        component: BindView,
        meta:{
            animate:'up'
        },
        children: [{
            path: '/bind-phone',
            name: 'bind-phone',
            meta:{
                title:'登录注册'
            },
            component: BindPhoneView
        }],
    },{
        path: '/contact-add',
        name: 'contact-add',
        meta:{
            title:'添加联系人'
        },
        component: ContactAddView
    },{
        path: '/contact-detail/:id',
        name: 'contact-detail',
        meta:{
            title:'个人详情'
        },
        component: ContactDetailView
    },{
        path: '/loan-in-want',
        name: 'loan-in-want',
        component: LoanInWantView,
        children: [{
            path: '/loan-in-want-index/:number',
            name: 'loan-in-want-index',
            meta:{
                title:'我要借款'
            },
            component: LoanInWantIndexView
        },{
            path: '/loan-in-want-use',
            name: 'loan-in-want-use',
            meta:{
                title:'借款用途'
            },
            component: LoanInWantUseView
        },]
    },{
        path: '/loan-in-success/:no',
        name: 'loan-in-success',
        meta:{
            title:'发布借款成功'
        },
        component: LoanInSuccessView
    },{
        path: '/loan-in-detail-me/:number',
        name: 'loan-in-detail-me',
        meta:{
            title:'借款详情'
        },
        component: LoanInDetailMeView
    },{
        path: '/loan-in-detail-other/:number',
        name: 'loan-in-detail-other',
        meta:{
            title:'借款详情'
        },
        component: LoanInDetailOtherView
    },{
        path: '/loan-out-record',
        name: 'loan-out-record',
        meta:{
            title:'我的出借记录'
        },
        component: LoanOutRecordView
    },{
        path: '/loan-out-want',
        name: 'loan-out-want',
        component: LoanOutWantView,
        meta:{
            title:'我要出借'
        },
        children: [{
            path: '/loan-out-want-index',
            name: 'loan-out-want-index',
            meta:{
                title:'我要出借'
            },
            component: LoanOutWantIndexView
        }]
    },{
        path: '/loan-out-success/:no',
        name: 'loan-out-success',
        meta:{
            title:'出借发布成功'
        },
        component: LoanOutSuccessView
    },{
        path: '/loan-out-detail-me/:number',
        name: 'loan-out-detail-me',
        meta:{
            title:'出借详情'
        },
        component: LoanOutDetailMeView
    },{
        path: '/loan-out-detail-other/:number',
        name: 'loan-out-detail-other',
        meta:{
            title:'出借详情'
        },
        component: LoanOutDetailOtherView
    },{
        path: '/loan-IOU/:number',
        name: 'loan-IOU',
        meta:{
            title:'借条'
        },
        component: LoanIOUView
    },{
        path: '/loan-IOU-add',
        name: 'loan-IOU-add',
        meta:{
            title:'补借条'
        },
        component: LoanIOUAddView
    },{
        path: '/loan-IOU-detail/:number',
        name: 'loan-IOU-detail',
        meta:{
            title:'补借条详情'
        },
        component: LoanIOUDetailView
    },{
        path: '/loan-IOU-list',
        name: 'loan-IOU-list',
        meta:{
            title:'我的补借条'
        },
        component: LoanIOUListView
    },{
        path: '/loan-out-apply',
        name: 'loan-out-apply',
        component: LoanOutApplyView
    },{
        path: '/user-money-detail',
        name: 'user-money-detail',
        meta:{
            title:'资金明细'
        },
        component: UserMoneyDetailView
    },{
        path: '/user-loan-in',
        name: 'user-loan-in',
        meta:{
            title:'借入资金'
        },
        component: UserLoanInVIew
    },{
        path: '/user-loan-out',
        name: 'user-loan-out',
        meta:{
            title:'出借资金'
        },
        component: UserLoanOutVIew
    },{
        path: '/user-no-repayment',
        name: 'user-no-repayment',
        meta:{
            title:'我的待还'
        },
        component: UserNoRepaymentVIew
    },{
        path: '/user-loan-in-detail',
        name: 'user-loan-in-detail',
        meta:{
            title:'我的待还'
        },
        component: UserLoanInDetailView
    },{
        path: '/user-loan-out-detail',
        name: 'user-loan-out-detail',
        meta:{
            title:'我的待收'
        },
        component: UserLoanOutDetailView
    },{
        path: '/user-with-draw',
        name: 'user-with-draw',
        meta:{
            title:'提现'
        },
        component: UserWithDrawView
    },{
        path: '/user-recharge',
        name: 'user-recharge',
        meta:{
            title:'充值'
        },
        component: UserRechargeView
    },{
        path: '/user-recharge-voucher',
        name: 'user-recharge-voucher',
        meta:{
            title:'点券充值'
        },
        component: UserRechargeVoucherView
    },{
        path: '/user-my-voucher',
        name: 'user-my-voucher',
        meta:{
            title:'我的点券'
        },
        component: UserMyVoucherView
    },{
        path: '/user-voucher-record',
        name: 'user-voucher-record',
        meta:{
            title:'充值记录'
        },
        component: UserVoucherRecordView
    },{
        path: '/user-mine',
        name: 'user-mine',
        meta:{
            title:'我的'
        },
        component: UserMineView
    },{
        path: '/user-bind-card',
        name: 'user-bind-card',
        component: UserBindCardView,
        children: [{
            path: '/user-bind-card-verified',
            name: 'user-bind-card-verified',
            meta:{
                title:'实名认证'
            },
            component: UserBindCardVerifiedView
        },{
            path: '/user-bind-card-transaction-password',
            name: 'user-bind-card-transaction-password',
            meta:{
                title:'设置交易密码'
            },
            component: UserBindCardTransactionPasswordView
        },{
            path: '/user-bind-card-success',
            name: 'user-bind-card-success',
            meta:{
                title:'绑定成功'
            },
            component: UserBindCardSuccessView
        },{
            path: '/user-bind-card-list',
            name: 'user-bind-card-list',
            meta:{
                title:'银行卡信息'
            },
            component: UserBindCardListView
        }]
    },{
        path: '/user-add-card',
        name: 'user-add-card',
        meta:{
            title:'添加银行卡'
        },
        component: UserAddCardView
    },{
        path: '/user-credit-report',
        name: 'user-credit-report',
        component: UserCreditReportView,
        children:[{
            path: '/user-credit-report-index',
            name: 'user-credit-report-index',
            meta:{
                title:'信用报告认证'
            },
            component: UserCreditReportIndexView
        },{
            path: '/user-credit-report-user-info/:no',
            name: 'user-credit-report-user-info',
            meta:{
                title:'个人信息'
            },
            component: UserCreditReportUserInfoView
        },{
            path: '/user-credit-report-zmxy/:no',
            name: 'user-credit-report-zmxy',
            meta:{
                title:'芝麻信用'
            },
            component: UserCreditReportZmxyView
        },{
            path: '/user-credit-report-operators/:no',
            name: 'user-credit-report-operators',
            meta:{
                title:'运营商'
            },
            component: UserCreditReportOperatorsView
        },{
            path: '/user-credit-report-operators360/:no',
            name: 'user-credit-report-operators360',
            meta:{
                title:'运营商'
            },
            component: UserCreditReportOperators360View
        },{
            path: '/user-credit-report-jd/:no',
            name: 'user-credit-report-jd',
            meta:{
                title:'京东'
            },
            component: UserCreditReportJdView
        },{
            path: '/user-credit-report-list',
            name: 'user-credit-report-list',
            meta:{
                title:'信用报告列表'
            },
            component: UserCreditReportListView
        },{
            path: '/user-credit-report-detail/:no',
            name: 'user-credit-report-detail',
            meta:{
                title:'信用报告详情'
            },
            component: UserCreditReportDetailView
        }]
    },{
        path: '/user-password-manage',
        name: 'user-password-manage',
        meta:{
            title:'密码管理'
        },
        component: UserPasswordManageView,
    },{
        path: '/user-password-find-login',
        name: 'user-password-find-login',
        meta:{
            title:'找回登录密码'
        },
        component: UserPasswordFindLoginView,
    },{
        path: '/user-password-find-transaction',
        name: 'user-password-find-transaction',
        meta:{
            title:'找回交易密码'
        },
        component: UserPasswordFindTransactionView,
    },{
        path: '/user-password-set-login',
        name: 'user-password-set-login',
        meta:{
            title:'设置登录密码'
        },
        component: UserPasswordSetLoginView,
    },{
        path: '/user-password-set-transaction',
        name: 'user-password-set-transaction',
        meta:{
            title:'设置交易密码'
        },
        component: UserPasswordSetTransactionView,
    },{
        path: '/user-password-set-success',
        name: 'user-password-set-success',
        meta:{
            title:'密码设置成功'
        },
        component: UserPasswordSetSuccessView,
    },{
        path: '/message-box',
        name: 'message-box',
        meta:{
            title:'消息盒子'
        },
        component: MessageBoxView,
    },{
        path: '/message-box-detail/:id',
        name: 'message-box-detail',
        meta:{
            title:'消息'
        },
        component: MessageBoxDetailView,
    },{
        path: '/help/',
        name: 'help',
        meta:{
            title:'使用帮助'
        },
        component: HelpView
    },{
        path: '/about',
        name: 'about',
        meta:{
            title:'关于我们'
        },
        component: AboutView
    },{
        path: '/share-loan-in/:number',
        name: 'share-loan-in',
        meta:{
            title:'有借分享'
        },
        component: ShareLoanInView
    },{
        path: '/share-loan-out/:number',
        name: 'share-loan-out',
        meta:{
            title:'有借分享'
        },
        component: ShareLoanOutView
    },{
        path: '/loan-in-apply',
        name: 'loan-in-apply',
        meta:{
            title:'我的借款记录'
        },
        component: LoanInApplyView
    },{
        path: '/view-record',
        name: 'view-record',
        meta:{
            title:'我的查看记录'
        },
        component: ViewRecordView
    },{
        path: '/id-select',
        name: 'id-select',
        meta:{
            title:'请认证身份'
        },
        component: IdSelectView
    },{
        path: '/loan-detail/:id',
        name: 'loan-detail',
        meta:{
            title:'负债详情'
        },
        component: LoanDetailView
    },{
        path: '/agreement',
        name: 'agreement',
        meta:{
            title:'协议'
        },
        component: AgreementView
    },{
        path: '/black-list',
        name: 'black-list',
        meta:{
            title:'黑名单'
        },
        component: BlackListView
    },{
        path: '/share-common',
        name: 'share-common',
        meta:{
            title:'有借分享'
        },
        component: ShareCommonView
    },
    // 邀请有奖
    // {
    //     path: '/invite-prize',
    //     name: 'invite-prize',
    //     meta:{
    //         title:'邀请有奖'
    //     },
    //     component: InvitePrizeView
    // }

    ,{
        path: '*', redirect: 'loan-in-index'
    }]
})

new config(router).render()

export default router
